﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.Composition;

namespace AlbumArtOrganizer.Plugins.FileSystem.Model
{
    [Export(AlbumScanner.AlbumScannerFactory.OPTIONCONTRACTNAME, typeof(AlbumArtOrganizer.Model.IOption))]
    public class OptionRootDirectory : AlbumArtOrganizer.Model.OptionDirectory
    {
        public override string Title
        {
            get
            {
                return "Root directory to scan";
            }
        }

        public override string Description
        {
            get
            {
                return "";
            }
        }

        string _value = null;
        public override string Value
        {
            get
            {
                if (String.IsNullOrEmpty(_value))
                {
                    _value = Properties.Settings.Default.OptionRootDirectory;
                }
                return _value;
            }
            set
            {
                _value = value;
                Properties.Settings.Default.OptionRootDirectory = value;
                Properties.Settings.Default.Save();
                OnPropertyChanged("Value");
                OnPropertyChanged("Directory");
            }
        }
    }
}
